<h1>New product</h1>
<% form_for(@product) do |f| %>
<%= f.error_messages %>
<p>
    <%= f.label :title %>
    <br/>
    <%= f.text_field :title %>
</p>
<p>
    <%= f.label :description %>
    <br/>
    <%= f.text_area :description %>
</p>
<p>
    <%= f.label :image_url %>
    <br/>
    <%= f.text_field :image_url %>
</p>
<p>
    <%= f.label :category %>
    <br/>
    <%= f.select :category,
    Category.find(:all).collect { |pt| [ pt.title ] },
    :prompt => "Select a category" %>
</p>
<p>
    <%= f.label :brand %>
    <br/>
    <%= f.select :brand,
    Brand.find(:all).collect { |pt| [ pt.title ] },
    :prompt => "Select a brand" %>
</p>
<p>
    <%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', products_path %>